<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" value="wudi" />
  </body>
  <script>
    var inp = document.querySelector("input");
    var str1 = "";
    inp.addEventListener("select", function () {
      var str = "";
      str = inp.value;
      //   console.log(str);
      return str;
    });
    console.log("1");
    console.log(str1);
  </script>
</html>
